<?php
namespace app\index\model;

use think\Model;

class Force extends Model
{   
   public function addUserForceStatistics($user_id){
      if(!db('force_statistics')->where('user_id',$user_id)->find()){
        $insert['user_id']     = $user_id;
        $insert['create_time'] = time();
        $insert['update_time'] = time();

        $insert_result = db('force_statistics')->insert($insert);
      }
   }

   //获取用户的战力信息
   public function getUserForceInfo($user_id){
      return db('force_statistics')->where('user_id',$user_id)->field('force_rank,force_total,force_best')->find();
   }
}